package com.heima.utils.thread;

import com.heima.model.admin.pojos.AdUser;
import com.heima.model.user.pojos.ApUser;

public class AdminThreadLocalUtil {
    private final static ThreadLocal<AdUser> ADMIN_USER_THREAD_LOCAL= new ThreadLocal<>();
    //存入线程
    public static void setUser(AdUser adUser) {
        ADMIN_USER_THREAD_LOCAL.set(adUser);
    }
    //从线程中获取
    public static AdUser getUser() {
        return ADMIN_USER_THREAD_LOCAL.get();
    }
    //清理线程数据
    public static void removeUser() {
        ADMIN_USER_THREAD_LOCAL.remove();
    }
}
